package com.itheima.stringbuilderdemo;

import java.util.Scanner;

public class StringBuilderDemo2 {
    public static void main(String[] args) {
        //链式编程
        int len = getString().substring(2).replace("a", "c").length();
        System.out.println(len);
    }

    //定义一个方法用于向键盘获取一个字符串
    public static String getString () {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str=sc.next();


        //返回
        return str;

    }
}
